home *** CD-ROM | disk | FTP | other *** search
/ No Fragments Archive 12: Textmags & Docs / nf_archive_12.iso / MAGS / SOURCES / ATARI_SRC.ZIP / atari source / FALCON / ACC / DRIVERS.ACC / MODIFY.C < prev    next >
Encoding:
C/C++ Source or Header  |  2001-02-10  |  18.0 KB  |  752 lines

  1. /* ===================================================================
  2.  * FILE: MODIFY.C
  3.  * ===================================================================
  4.  * DATE: December 1, 1992
  5.  *     January 15, 1993 Write the ASSIGN.SYS immediately once
  6.  *              we add or modify the device.
  7.  * 
  8.  * DESCRIPTION: DRIVERS ACC
  9.  *
  10.  * This file handles the modify dialog box which lets the user
  11.  * add or modify a device.
  12.  *
  13.  * COMPILER: TURBO C Version 2.0
  14.  */
  15.  
  16.  
  17. /* INCLUDE FILES
  18.  * ===================================================================
  19.  */
  20. #include <sys\gemskel.h>
  21. #include <tos.h>
  22. #include <linea.h>
  23. #include <stdlib.h>
  24.  
  25. #include "country.h"
  26. #include "drvhead.h"
  27. #include "drivers.h"
  28. #include "fixrsh.h"
  29. #include "mainstuf.h"
  30. #include "xform_do.h"
  31. #include "windows.h"
  32. #include "text.h"
  33. #include "fsmio.h"
  34. #include "mover.h"
  35. #include "options.h"
  36. #include "device.h"
  37. #include "popmenu.h"
  38.  
  39.  
  40. /* STRUCTURE
  41.  * ===================================================================
  42.  */
  43. struct foobar {
  44.     WORD    dummy;
  45.     WORD    *image;
  46.     };
  47.  
  48.  
  49. /* EXTERN
  50.  * ===================================================================
  51.  */
  52. extern int AES_Version;
  53. void    WaitForUpButton( void );
  54.  
  55.  
  56.  
  57. /* PROTOTYPES
  58.  * ===================================================================
  59.  */
  60. void    DoModify( int obj, DEV_PTR curptr );
  61. int    Modify_Button( int button, WORD *msg );
  62. void    DoNamePopUp( void );
  63. void    DoROMRES( int button );
  64. void    DoUpDown( int button );
  65.  
  66.  
  67.  
  68. /* DEFINES
  69.  * ===================================================================
  70.  */
  71. #define MENU_HEIGHT    16
  72. #define MIN_DEV 10
  73.  
  74.  
  75.  
  76. /* GLOBALS
  77.  * ===================================================================
  78.  */
  79. char numtext[] = "   ";
  80. int  menuid;
  81. int  dcurvalue;
  82. int  dcurdevice;
  83. DEV_PTR dcurptr;
  84. int  dtype;
  85. int  dcurflag;
  86. int  startnum;
  87. int  scrn_id;
  88.  
  89.  
  90.  
  91.  
  92. /* FUNCTIONS
  93.  * ===================================================================
  94.  */
  95.  
  96.  
  97. /* DoCustom()
  98.  * ===================================================================
  99.  */
  100. void
  101. DoModify( int obj, DEV_PTR curptr )
  102. {
  103.    Reset_Tree( ad_modify );
  104.    
  105.    dcurptr = curptr;        /* Save off the device pointer  */
  106.    dtype = obj;            /* and whether its MODIFY or ADD*/
  107.       
  108.    if( obj == DMODIFY )
  109.       TedText( MTITLE ) = modtext;     
  110.    else
  111.       TedText( MTITLE ) = addtext;
  112.  
  113.    /* Get the screen ID index */
  114.    scrn_id = find_driver( "SCREEN.SYS" );
  115.  
  116.  
  117.    /* Clear the ROM/RESIDENT buttons */
  118.    Deselect( MROMYES );
  119.    Deselect( MROMNO );
  120.    Deselect( MRESYES );
  121.    Deselect( MRESNO );
  122.    ShowObj( ROMBASE );
  123.    ShowObj( ROMTITLE );
  124.  
  125.    /* Setup the UP/DOWN/EDIT buttons */
  126.    Enable( MUP );
  127.    Enable( MDOWN );
  128.    Enable( MEDIT );
  129.    MakeEditable( MEDIT );
  130.    MakeTouchExit( MUP );
  131.    MakeTouchExit( MDOWN );
  132.  
  133.  
  134.    /* Check if there isn't any drivers..then no popup */
  135.    MakeShadow( MNAME );
  136.    MakeTouchExit( MNAME );
  137.  
  138.    /* NOTE- SCREEN.SYS means that there will always be at least one*/
  139.    if( driver_count <= 1 )
  140.    {
  141.        NoShadow( MNAME );
  142.        NoTouchExit( MNAME );
  143.    }
  144.    
  145.    
  146.    
  147.    
  148.    if( obj == DMODIFY )
  149.    {
  150.       if( curptr )
  151.       {
  152.      /* Get the device number */
  153.      startnum = dcurdevice = DDEV( curptr );
  154.          sprintf( numtext, "%3d", DDEV( curptr ) );
  155.      TedText( MEDIT ) = numtext;
  156.  
  157.      /* Get printer name */    
  158.      dcurvalue = DNAME( curptr );
  159.      TedText( MNAME ) = drivers[ DNAME( curptr ) ];
  160.  
  161.  
  162.      /* Get whether its resident or not */
  163.      dcurflag = DTYPE( curptr );
  164.      if( DTYPE( curptr ) == 'R')
  165.             Select( MRESYES );
  166.      else
  167.         Select( MRESNO );
  168.  
  169.      /* Get whether its in ROM or not */
  170.      if( DTYPE( curptr ) == 'P' )
  171.             Select( MROMYES );
  172.      else
  173.         Select( MROMNO );
  174.  
  175.  
  176.      /* If this is a screen device, 1-9, don't let them touch
  177.       * the device scrolling stuff. ALSO
  178.       * If we are displaying the screen.sys driver AND the
  179.       * device num is MIN_DEV, (10), then disable the buttns also.
  180.       */
  181.      if( ( dcurdevice <= 9 ) ||
  182.        ( ( dcurdevice == MIN_DEV ) && ( scrn_id == dcurvalue ) ))
  183.      {
  184.        Disable( MUP );
  185.        Disable( MDOWN );
  186.        Disable( MEDIT );
  187.        NoEdit( MEDIT );
  188.        NoTouchExit( MUP );
  189.        NoTouchExit( MDOWN );
  190.      }
  191.      
  192.      /* If device >= 10, they can't be in ROM, so hide it! */
  193.      if( dcurdevice > MIN_DEV )
  194.      {
  195.         HideObj( ROMBASE );
  196.         HideObj( ROMTITLE );
  197.      }
  198.      
  199.       }
  200.    }
  201.  
  202.    if( obj == DADD )
  203.    {
  204.        dcurvalue = 0;    /* Initialize the starting driver to 0 */
  205.                    /* In other words, the first one...    */
  206.    
  207.        /* Adding a Device - they can't be in ROM, so hide it!
  208.         * Except for device 10
  209.         */
  210.  
  211.        /* Initial Device that we can start with.*/
  212.        dcurdevice = MIN_DEV - 1;
  213.        
  214.        /* Find an UNUSED device number */
  215.        do
  216.        {
  217.           dcurdevice++;
  218.           
  219.           /* If we exceed the MAX, then no more device addons..*/
  220.           if( dcurdevice >= MAX_NUM_DEV )
  221.           {
  222.               form_alert( 1, alert7 );
  223.             Reset_Tree( ad_device );     
  224.         Objc_draw( tree, ROOT, MAX_DEPTH, NULL ); 
  225.         return;
  226.           }
  227.        }while( find_device( dcurdevice ) );
  228.  
  229.  
  230.        /* ALSO, if more than 50 devices, then no more also. */
  231.        if( ( device_count + 1 ) >= MAX_DRIVERS )
  232.        {
  233.             /* no more room for any more devices */
  234.             form_alert( 1, alert7 );
  235.         Reset_Tree( ad_device );     
  236.         Objc_draw( tree, ROOT, MAX_DEPTH, NULL ); 
  237.         return;
  238.        }
  239.  
  240.  
  241.        /* If device >= 10, they can't be in ROM, so hide it! */
  242.        if( dcurdevice > MIN_DEV )
  243.        {
  244.          HideObj( ROMBASE );
  245.          HideObj( ROMTITLE );
  246.        }  
  247.  
  248.  
  249.        /* If we start off with trying to add a screen.sys driver
  250.         * and a device less than or equal to MIN_DEV, we disable
  251.         * the UP/DOWN/EDIT buttons.
  252.         */
  253.        if(( dcurdevice <= MIN_DEV ) && ( scrn_id == dcurvalue ) )
  254.        {
  255.        Disable( MUP );
  256.        Disable( MDOWN );
  257.        Disable( MEDIT );
  258.        NoEdit( MEDIT );
  259.        NoTouchExit( MUP );
  260.        NoTouchExit( MDOWN );
  261.        }
  262.       
  263.        startnum = dcurdevice;
  264.        sprintf( numtext, "%3d", dcurdevice );
  265.        TedText( MEDIT ) = numtext;
  266.  
  267.        /* Initial printer name */    
  268.        TedText( MNAME ) = drivers[ dcurvalue ];
  269.  
  270.        /* Set Resident/ROM status to nothing */
  271.        dcurflag = ' ';
  272.        Select( MRESNO );
  273.        Select( MROMNO );
  274.    }
  275.  
  276.    Objc_draw( tree, ROOT, MAX_DEPTH, NULL ); 
  277. }
  278.  
  279.  
  280. /* Modify_Button()
  281.  * ===================================================================
  282.  */
  283. int
  284. Modify_Button( int button, WORD *msg )
  285. {
  286.    int     quit;
  287.    DEV_PTR curptr;
  288.    int     num;
  289.    int     obj; 
  290.    MRETS   mk;
  291.    
  292.    quit   = FALSE;
  293.       
  294.    /* Handle Double-clicking of the objects */   
  295.    if( ( button != -1 ) && ( button & 0x8000 ) )
  296.    {
  297.       button &= 0x7FFF;      
  298.    }   
  299.    
  300.    switch( button )
  301.    {
  302.      case MOK:    
  303.             /* Get the status of the ROM/RES flags */
  304.             dcurflag = ' ';
  305.                  if( IsSelected( MROMYES ) ) /* Put INTO ROM */
  306.                      dcurflag  = 'P';
  307.                     
  308.                  if( IsSelected( MRESYES ) ) /* Put into RAM */
  309.                      dcurflag = 'R';
  310.      
  311.      
  312.      
  313.      
  314.                       if( dtype == DMODIFY )  /* MODIFY the DEVICE */
  315.                  {
  316.                     /* If these are > 9, then let them modify devnum */
  317.                     if( DDEV( dcurptr ) >= MIN_DEV )
  318.                     {        
  319.                  num = atoi( numtext );
  320.   
  321.                  if(( num >= MIN_DEV ) && ( num <= ( MAX_NUM_DEV - 1 )))
  322.                      dcurdevice = num;
  323.                }      
  324.  
  325.                /* Make the Actual Change ONLY if a change has
  326.                 * been made.
  327.                 */
  328.                if( ( DDEV( dcurptr )  != dcurdevice ) ||
  329.                    ( DNAME( dcurptr ) != dcurvalue  ) ||
  330.                    ( DTYPE( dcurptr ) != dcurflag ) )
  331.                {
  332.  
  333.               /* Look to see if we're moving to an OCCUPIED
  334.                * LOCATION. Other than its own, that is..
  335.                */
  336.               curptr = find_device( dcurdevice );
  337.               if( curptr && ( curptr != dcurptr ) )
  338.               {
  339.                  if( form_alert( 1, alert55 ) == 2 )
  340.                  {
  341.                      /* Cancel */
  342.                      XDeselect( tree, MOK );
  343.                      return( quit );
  344.                  }
  345.                  DeleteDevice( dcurdevice );                 
  346.               }
  347.               
  348.               /* If this is the printer device, clear the cur_cdriver variable
  349.                * BUT ONLY if the new device is not the printer device.
  350.                */
  351.               if( ( DDEV( dcurptr ) == 21 ) && ( dcurdevice != 21 ))
  352.                   cur_cdriver = -1;
  353.                   
  354.                        DDEV( dcurptr )  = dcurdevice; 
  355.                        DNAME( dcurptr ) = dcurvalue;
  356.                        DTYPE( dcurptr ) = dcurflag;
  357.                        SortDevices();   
  358.                     }
  359.             }
  360.  
  361.  
  362.             /* ADD A NEW DEVICE! */
  363.             if( dtype == DADD )
  364.             {
  365.                /* Get the Device Value */
  366.                dcurdevice = atoi( numtext );
  367.   
  368.                  /* Check if we are within limits */
  369.                  if( ( dcurdevice < MIN_DEV ) ||
  370.                      ( dcurdevice >= MAX_NUM_DEV ))
  371.                  {
  372.                     /* NO- WE ARE NOT! */
  373.                     form_alert( 1, alert57 );
  374.               XDeselect( tree, MOK );
  375.                     return( quit );
  376.                  }
  377.                  
  378.                  /* See if the device already EXISTS! */
  379.                  dcurptr = find_device( dcurdevice );
  380.                  if( dcurptr )
  381.                  {
  382.                     /* YES! REPLACE! or REFACE!*/
  383.               if( form_alert( 1, alert55 ) == 2 )
  384.               {
  385.                   /* Cancel */
  386.                   XDeselect( tree, MOK );
  387.                   return( quit );
  388.               }
  389.               /* REPLACE! So Delete that device */
  390.               DeleteDevice( dcurdevice );                 
  391.                  }
  392.                  
  393.                  /* no more ROOM! */
  394.                  dcurptr = AddNewDevice( dcurdevice );
  395.                  if( !dcurptr )
  396.                  {
  397.                   XDeselect( tree, MOK );
  398.                     return( quit );
  399.                  }   
  400.  
  401.                /* Put the DATA INTO the Node */                    
  402.                      DDEV( dcurptr )  = dcurdevice; 
  403.                     DNAME( dcurptr ) = dcurvalue;
  404.                     DTYPE( dcurptr ) = dcurflag;
  405.             }
  406.             SetChangeFlag();   
  407.             
  408.             /* WRITE THE ASSIGN.SYS IMMEDIATELY */
  409.             write_assign();
  410.             
  411.      case MCANCEL:  Deselect( button );
  412.             Reset_Tree( ad_device );     
  413.  
  414.             Disable( DMODIFY );
  415.             Disable( DDELETE );
  416.             NoExit( DMODIFY );
  417.             NoExit( DDELETE );
  418.  
  419.             device_mover_setup( device_head, device_count,
  420.                         DBASE, DSLIDE, DUP, DDOWN,
  421.                         DLINE0, DLINE11, DLINE, 0, 12 );
  422.  
  423.             Objc_draw( tree, ROOT, MAX_DEPTH, NULL ); 
  424.                  break;
  425.  
  426.      case MNAME:   XSelect( tree, MNAME );
  427.                 do
  428.                 {
  429.               Graf_mkstate( &mk );
  430.               obj = objc_find( tree, ROOT, MAX_DEPTH, mk.x, mk.y );
  431.               if( obj != MNAME )
  432.               {
  433.                  if( IsSelected( MNAME ) )
  434.                    XDeselect( tree, MNAME );
  435.               }
  436.  
  437.              if( obj == MNAME )
  438.              {
  439.                 if( !IsSelected( MNAME ) )
  440.                   XSelect( tree, MNAME );
  441.              }         
  442.             }while( mk.buttons );
  443.               
  444.             if( obj == MNAME )
  445.                DoNamePopUp();
  446.                
  447.            if( IsSelected( MNAME ) )    
  448.               XDeselect( tree, MNAME );    
  449.            break;
  450.  
  451.      case MRESYES:
  452.      case MRESNO:
  453.      case MROMYES:
  454.      case MROMNO:  DoROMRES( button );
  455.                 break;
  456.  
  457.  
  458.      case MUP:
  459.      case MDOWN: DoUpDown( button );
  460.               break;
  461.                               
  462.      default:     if( button == -1 )
  463.               {
  464.                 switch( msg[0] )
  465.                 {
  466.                   case WM_REDRAW: 
  467.                                break;
  468.                                    
  469.                   case AC_CLOSE:  quit = TRUE;
  470.                                break;
  471.                                        
  472.                   case WM_CLOSED: quit = TRUE;
  473.                                CloseWindow();
  474.                      break;
  475.  
  476.              case CT_KEY:
  477.                           break;
  478.                   default:
  479.                           break;
  480.                 }
  481.               }
  482.               break;
  483.    }
  484.    return( quit );
  485.  
  486. }
  487.  
  488.  
  489.  
  490. /* DoNamePopUp()
  491.  * ===================================================================
  492.  */
  493. void
  494. DoNamePopUp( void )
  495. {
  496.       GRECT rect;
  497.       long  value;
  498.       int   item, id;
  499.  
  500.       InitPopUpMenus();
  501.       SetSubMenuDelay( 300L );
  502.       SetSubDragDelay( 3000L );
  503.       SetArrowClickDelay( 150L );
  504.  
  505.       rect = ObRect( MNAME );
  506.       objc_offset( tree, MNAME, &rect.g_x, &rect.g_y );
  507.       menuid  = InsertPopUpMenu( display[0], driver_count, MENU_HEIGHT );
  508.  
  509.       CheckItem( menuid, dcurvalue, TRUE );
  510.       SetStartItem( menuid, dcurvalue );
  511.       
  512.       /* Disable the Screen Item if the device num is > MIN_DEV */
  513.       EnableItem( menuid, scrn_id );
  514.       if(( dcurdevice > MIN_DEV ) )
  515.           DisableItem( menuid, scrn_id );
  516.  
  517.       value = PopUpMenuSelect( menuid, rect.g_x, rect.g_y, dcurvalue );        
  518.       if( value != -1L )
  519.       {
  520.          item  = (int)value;
  521.          id = (int)( value >> 16L );
  522.  
  523.          if( ( item != -1 ) && ( id == menuid ) )
  524.          {
  525.             CheckItem( id, dcurvalue, FALSE );
  526.             CheckItem( id, item, TRUE );
  527.             dcurvalue = item;
  528.             SetStartItem( id, item );
  529.             
  530.         TedText( MNAME ) = drivers[ dcurvalue ];
  531.         RedrawObject( tree, MNAME );
  532.  
  533.         /* If we have selected screen.sys, then disable
  534.          * the scrolling buttons IF we are at device 10 or less.
  535.          */
  536.             if( ( dcurdevice <= MIN_DEV ) && ( scrn_id == dcurvalue ) )
  537.             {
  538.                if( !IsDisabled( MUP ) )
  539.                {
  540.               Disable( MUP );
  541.               Disable( MDOWN );
  542.               Disable( MEDIT );
  543.               NoEdit( MEDIT );
  544.               NoTouchExit( MUP );
  545.               NoTouchExit( MDOWN );
  546.  
  547.               RedrawObject( tree, MUP );
  548.               RedrawObject( tree, MDOWN );
  549.               RedrawObject( tree, MEDIT );
  550.            }  
  551.             }
  552.             else
  553.             {
  554.                if( ( dcurdevice >= MIN_DEV ) && IsDisabled( MUP ) )
  555.                {
  556.               Enable( MUP );
  557.               Enable( MDOWN );
  558.               Enable( MEDIT );
  559.               MakeEditable( MEDIT );
  560.               MakeTouchExit( MUP );
  561.               MakeTouchExit( MDOWN );
  562.               
  563.               RedrawObject( tree, MUP );
  564.               RedrawObject( tree, MDOWN );
  565.               RedrawObject( tree, MEDIT );
  566.                }
  567.             }
  568.                     
  569.        }    
  570.       }    
  571.     
  572.       DeletePopUpMenu( menuid );
  573.  
  574. }
  575.  
  576.  
  577.  
  578. /* DoROMRES()
  579.  * =======================================================================
  580.  * Handle the Current Driver ROM/RES flag.
  581.  */
  582. void
  583. DoROMRES( int button )
  584. {
  585.     WaitForUpButton();
  586.     
  587.     if( button == MROMYES )
  588.     {
  589.         if( IsSelected( MROMNO ) )
  590.            XDeselect( tree, MROMNO );
  591.            
  592.         if( !IsSelected( MROMYES ) )   
  593.            XSelect( tree, MROMYES );
  594.            
  595.         if( IsSelected( MRESYES ) )
  596.         {
  597.             XDeselect( tree, MRESYES );
  598.             XSelect( tree, MRESNO );
  599.         }   
  600.     }
  601.  
  602.  
  603.     if( button == MROMNO )
  604.     {
  605.         if( IsSelected( MROMYES ) )
  606.            XDeselect( tree, MROMYES );
  607.         
  608.         if( !IsSelected( MROMNO ))
  609.            XSelect( tree, MROMNO );
  610.     }
  611.  
  612.  
  613.  
  614.     if( button == MRESYES )
  615.     {
  616.         if( IsSelected( MRESNO ) )
  617.            XDeselect( tree, MRESNO );
  618.            
  619.         if( !IsSelected( MRESYES ) )   
  620.            XSelect( tree, MRESYES );
  621.  
  622.     if( !IsHidden( ROMBASE ) )
  623.     {
  624.           if( IsSelected( MROMYES ) )
  625.           {
  626.              XDeselect( tree, MROMYES );
  627.              XSelect( tree, MROMNO );
  628.           }   
  629.         }  
  630.     }
  631.  
  632.  
  633.     if( button == MRESNO )
  634.     {
  635.         if( IsSelected( MRESYES ) )
  636.            XDeselect( tree, MRESYES );
  637.         
  638.         if( !IsSelected( MRESNO ))
  639.            XSelect( tree, MRESNO );
  640.     }
  641. }
  642.  
  643.  
  644.  
  645.  
  646. /* DoUpDown()
  647.  * =======================================================================
  648.  * Handles the Up/Down Arrows for the device num
  649.  */
  650. void
  651. DoUpDown( int button )
  652. {
  653.     MRETS mk;
  654.     int   oldnum;
  655.     int   redraw_flag;
  656.             
  657.     XSelect( tree, button );
  658.     
  659.     /* Get the text value of the device from the dialog box */
  660.     redraw_flag = FALSE;
  661.     dcurdevice = atoi( numtext );
  662.   
  663.     if( dcurdevice < MIN_DEV )
  664.     {
  665.        dcurdevice = MIN_DEV;
  666.        redraw_flag = TRUE;
  667.     }
  668.     
  669.     if( dcurdevice > ( MAX_NUM_DEV - 1 ) )
  670.     {
  671.        dcurdevice = ( MAX_NUM_DEV - 1 );
  672.        redraw_flag = TRUE;
  673.     }   
  674.  
  675.     do
  676.     {
  677.        oldnum = dcurdevice;
  678.  
  679.        if( button == MUP )
  680.        {
  681.          do
  682.          {
  683.            if( dcurdevice < ( MAX_NUM_DEV - 1 ) )    
  684.                dcurdevice++;
  685.             else
  686.             {
  687.                dcurdevice = oldnum;
  688.                break;    
  689.             }
  690.             
  691.             if( dcurdevice == startnum )
  692.                break;
  693.           }while( find_device( dcurdevice ) );  
  694.        }
  695.        else  /* button == MDOWN */
  696.        {
  697.          do
  698.          {
  699.        if( dcurdevice >= MIN_DEV )
  700.                dcurdevice--;
  701.             else
  702.             {
  703.                dcurdevice = oldnum;
  704.                break;   
  705.             }
  706.             
  707.             if( dcurdevice == startnum )
  708.                break;   
  709.           }while( find_device( dcurdevice ) );     
  710.        
  711.        }
  712.  
  713.        if( ( oldnum != dcurdevice ) || redraw_flag )
  714.        {
  715.          /* Check if we should display ROM variables or NOT.
  716.           * We display them if the device is 10 or less.
  717.           */
  718.          if( dcurdevice > MIN_DEV )
  719.          {
  720.          
  721.             if( !IsHidden( ROMBASE ) )
  722.             {
  723.               HideObj( ROMBASE );
  724.               HideObj( ROMTITLE );
  725.               RedrawObject( tree, ROMBASE );
  726.               RedrawObject( tree, ROMTITLE );
  727.             }   
  728.          }
  729.          else
  730.          {
  731.             if( IsHidden( ROMBASE ) )
  732.             {
  733.               ShowObj( ROMBASE );
  734.               ShowObj( ROMTITLE );
  735.               RedrawObject( tree, ROMBASE );
  736.               RedrawObject( tree, ROMTITLE );
  737.             }
  738.          }
  739.          /* Display the new Device Num */
  740.          sprintf( numtext, "%d", dcurdevice );
  741.          TedText( MEDIT ) = numtext;
  742.         
  743.          Objc_draw( tree, MEDIT, MAX_DEPTH, NULL );
  744.        }  
  745.            
  746.        Evnt_timer( 100L );
  747.        Graf_mkstate( &mk );
  748.     }while( mk.buttons );   
  749.     
  750.     XDeselect( tree, button );
  751. }
  752.